package com.huabo.contract.oracle.mapper;

import com.huabo.contract.oracle.entity.TblYyPrice;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author huabo
 * @since 2022-04-07
 */
public interface TblYyPriceMapper extends BaseMapper<TblYyPrice> {

    @Select("select INTERFACENAME from TBL_YY_PRICE where PRICEID in(SELECT\n" +
            "\tREGEXP_SUBSTR( (SELECT PRICEID FROM TBL_YY_REPORT_MODEL WHERE REPORTID = #{reportid}), '[^,]+', 1, LEVEL ) \n" +
            "FROM\n" +
            "\tDUAL CONNECT BY REGEXP_SUBSTR( (SELECT PRICEID FROM TBL_YY_REPORT_MODEL WHERE REPORTID = #{reportid}), '[^,]+', 1, LEVEL ) IS NOT NULL) and INTERFACENAME != '基本信息' and INTERFACENAME != '核心团队' ")
    List<TblYyPrice> findByIs(BigDecimal reportid);

    @Select("select * from TBL_YY_PRICE where PRICEID>=2 order by PRICEID")
    List<TblYyPrice> findAll();

}
